<template>
	<view class="container">
		<view class="head">
			
		</view>
		<view class="box">
			
			<view class="item">
				
				<input placeholder="请输入密码" password type="text" v-model="password" placeholder-style="color: #BBBBBB;"/>
				
			</view>
			
			<view class="item">
				
				<input placeholder="再次确认密码" password type="text" v-model="repassword" placeholder-style="color: #BBBBBB"/>
				
			</view>
			
		</view>
		
		<view class="foot">
		
			<view class="btn" @click="reset">
				确定
			</view>
		</view>
		

	</view>
</template>

<script>
	import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
	import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins'
	import * as UserApi from '@/api/user'
	import {
		getEmptyPaginateObj,
		getMoreListData
	} from '@/core/app'



	export default {
		components: {
			MescrollBody
		},
		mixins: [MescrollMixin],
		data() {
			return {
				password:'',
				repassword:''
			}
		},

		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad(options) {
			
			
		},

		methods: {
			
			reset(){
				const app = this
							
				if (app.password=='') {
					this.$toast('请输入密码')
					return false
				}
				if (app.password!=app.repassword) {
					this.$toast('密码不一致')
					return false
				}
				app.isLoading = true
				
				
				UserApi.reset({
				    form: {
				      password: app.password
				    }
				  })
				  .then(result => {
				    // 显示发送成功
				    app.$toast(result.message)
				 setTimeout(() => uni.navigateBack(), 2000)
				  })
				  .finally(() => app.isLoading = false)
				
				
				
			}




		}
	}
</script>

<style lang="scss" scoped>
	
	.foot {
	
		width: 60%;
		margin: auto;
		margin-top: 50rpx;
	}
	
	.btn {
		width: 100%;
		height: 80rpx;
		border-radius: 8rpx;
		font-size: 40rpx;
		background: linear-gradient(180deg, rgba(22, 132, 252, 1) 0%, rgba(100, 174, 255, 1) 100%);
		color: rgba(255, 255, 255, 1);
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.container {
	

	}
	.head{
		height: 200rpx;
		background: linear-gradient(180deg, rgba(22,132,252,1) 0%,rgba(116,219,254,0.88) 100%);
	}
	.box{
		padding: 50rpx 60rpx;
		margin-top: 100rpx;
	}
	.item{
	
		border-bottom: solid 2rpx #BBBBBB;
		padding-top: 50rpx;
		padding-bottom: 20rpx;
	}
	
	

	
</style>